home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / MPW / Examples / CFMExamples / CSharedLibrarySample / ShLibExample.make < prev    next >
Encoding:
Text File  |  1998-12-03  |  2.8 KB  |  94 lines  |  [TEXT/MPS ]

  1. #   File:       ShLibExample.make
  2. #
  3. #   Builds a fat application and it's shared library.
  4. #
  5.  
  6. AppName = ShLibExample
  7. MakeFile = {AppName}.make
  8. App_Type = 'APPL'
  9. App_Creator = '????'
  10. App_Objects = Main.c.o
  11. M68KApp_Objects = Main.o
  12. App_Resources = {AppName}.r
  13.  
  14. LibName = SharedLib
  15. Lib_Type = 'shlb'
  16. Lib_Creator = '????'
  17. Lib_Objects = SharedLib.c.o
  18. M68KLib_Objects = SharedLib.o
  19. Lib_Exports = SharedLib.c.x   # Names of export file produced by PPCC for our library.
  20. Lib_Resources = {LibName}.r
  21.  
  22. Headers = SharedLib.h
  23.  
  24. SymOpt  = off
  25. MrCOPT = off
  26.  
  27. MrC_Options = -sym {SymOpt} -opt {MrCOPT} -w 17
  28. SC_Options   = -model cfmseg -sym {SymOpt} -mbg full -i {cincludes} -i : -w 17
  29.  
  30. PPCLink_Options = -sym {SymOpt}
  31. ILink_Options =   -sym {SymOpt} -mf -model cfmseg
  32.  
  33. ILink_Libraries =  "{SharedLibraries}"InterfaceLib  ∂
  34.                    "{SharedLibraries}"StdClib ∂
  35.                    "{CFM68KLibraries}"NuMacRuntime.o
  36.                     
  37. PPC_Sys_Libraries = "{SharedLibraries}"InterfaceLib ∂
  38.                     "{SharedLibraries}"StdCLib ∂
  39.                     "{PPCLibraries}"StdCRuntime.o ∂
  40.                     "{PPCLibraries}"PPCCRuntime.o
  41.  
  42. .c.o ƒ .c {MakeFile}  # An object depends upon it's source. All Objects depend on the Makefile.
  43.     MrC {MrC_Options} {default}.c -o {Targ}
  44.  
  45. .o ƒ .c {MakeFile}  # An object depends upon it's source. All Objects depend on the Makefile.
  46.     SC {SC_Options} {default}.c -o {Targ}
  47.  
  48. All ƒ {LibName} {AppName} 
  49.  
  50. {App_Objects} {Lib_Objects} ƒƒ {Headers}
  51.  
  52. {AppName}.68k ƒƒ {M68KApp_Objects} {LibName}
  53.     ILink {ILink_Options}  -xm e ∂
  54.         {deps} ∂
  55.         {ILink_Libraries} ∂
  56.         -o {targ}
  57.  
  58. {AppName}.ppc ƒƒ {App_Objects} {LibName}
  59.     PPCLink ∂
  60.         {deps} ∂
  61.         -o {Targ} ∂
  62.         {PPC_Sys_Libraries}
  63.         
  64. {AppName} ƒ {AppName}.68k {AppName}.ppc {App_Resources} {MakeFile}
  65.     duplicate -y {AppName}.68k {Targ}
  66.     MergeFragment {AppName}.ppc {Targ}
  67.     Rez {App_Resources} -a -o {Targ}
  68.     
  69. # In truth, our application depends upon the external interfaces of our shared lib
  70. # (i.e. the application does not have to be rebuilt every time the library is.  But this
  71. # rule makes life simplier since we need a library with some good external interfaces
  72. # to link our application with.
  73.  
  74.         
  75. {LibName} ƒ {LibName}.ppc  {LibName}.68k
  76.     delete -i {targ}
  77.     MergeFragment -x {deps} {targ} 
  78.     Rez {Lib_Resources} -a -o {Targ}
  79.     setfile -c {Lib_Creator} -t {Lib_Type} {targ}
  80.  
  81. {LibName}.ppc ƒ  {Lib_Objects}
  82.     PPCLink {PPCLink_Options} -xm s    # Note option to create shared lib (-xm s). ∂
  83.             {Lib_Objects} ∂
  84.             {PPC_Sys_Libraries} ∂
  85.             -o {Targ}
  86.     MergeFragment -n {LibName} -c -t pwpc -x {targ}  # use MergeFragment to create a library cfrg
  87.  
  88. {LibName}.68k ƒ  {M68KLib_Objects}
  89.     ILink {ILink_Options} -xm s         # Note option to create shared lib  ∂
  90.             {M68KLib_Objects} ∂
  91.             {ILink_Libraries} ∂
  92.             -o {Targ}
  93.     MakeFlat {targ} -o {targ}            
  94.     MergeFragment -n {LibName} -c -t m68k -x {targ}  # use MergeFragment to create a library cfrg